package com.linwen.javase.jvm;

import java.util.ArrayList;

/**
 * @author wlw
 * @date 2023/3/14 12:15 AM
 *
 * -Xms10m
 * -Xmx10m
 * -XX:+PrintGCDetails
 * -XX:+HeapDumpOnOutOfMemoryError
 */
public class TestOOM {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();
        while (true){
            list.add(new OOM());
        }
    }
}
class OOM{
    int[] arr = new int[1024*1024];
}
